<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<!-- Dropdown Starts -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.hoverIntent.minified.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);
});
</script>
    <!-- Dropdown Ends -->
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div id="page">

	<div id="header" class="heading_bg">
		
		<div align="center"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/quiz1.gif" align="middle" height="100px" width="100px" ></img></div>
	
<?php
	if (!Yii::app()->user->isGuest)
	{
	echo '<div class="login_wrapper">';	
	echo "<p>Welcome!<b>".Yii::app()->user->name."</b></p>";
 	echo CHtml::link(Yii::app()->getModule('admin')->t("Logout").' ',Yii::app()->getModule('admin')->logoutUrl, array('class'=>'logout')); 
	echo '</div>';	
	}
 ?>
	</div><!-- header -->
	
	
	<?php 
		$userManage = null;
		$profileManage = null;
		$restaurantTop= null;
		$emailTemplateTop=null;
		$staticpagesTop=null;
		$bannerDetailsTop=null;
		$reportTop = null;
		$accessTop = null;
		$changePassword = null;
		$locationsTop=null;
		$customersTop=null;
		$dashboard=null;
		if(isset(Yii::app()->params['top']))
			{
				
				if(Yii::app()->params['top']=='dashboard')
					{
						$dashboard = 'class="selected"';
					}
				if(Yii::app()->params['top']=='userManage')
					{
						$userManage = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='profileManage')
					{
						$profileManage = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='vacationTop')
					{
						$vacationTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='restaurantTop')
					{
						$restaurantTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='emailTemplateTop')
					{
						$emailTemplateTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='staticPagesTop')
					{
						$staticpagesTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='bannerDetailsTop')
					{
						$bannerDetailsTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='locationsTop')
					{
						$locationsTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='customersTop')
					{
						$customersTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='accessTop')
					{
						$accessTop = array('class'=>'selected');
					}
				if(Yii::app()->params['top']=='changePassword')
					{
						$changePassword = array('class'=>'selected');
					}
			}
	
	?>
	
         <ul id="topnav">
        <?php if (!Yii::app()->user->isGuest)
	{ ?>
         <li <?php echo $dashboard;?>><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "profile");?>">Home</a>
        </li>
        <li><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "profile");?>">My Profile</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "edit");?>">Edit Profile</a></li>
                    <li><a href="<?php echo ApplicationConfig::getURL("admin", "profile", "changepassword");?>">Change Password</a></li>
                </ul>
        </div>
        </li>
        <?php if(Yii::app()->getModule('admin')->isAdmin()){?>
        <li><a href="#">User Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="/clients/quiz/index.php/admin/cpanel/manage">Manage Users</a></li>
                	<li><a href="/clients/quiz/index.php/admin/cpanel/create">Create User</a></li>
					<li><a href="clients/quiz/index.php/admin/permission">Manage Permission</a></li>
					
                </ul>
        </div>
        </li>
     <?php }?>
       <!--   <li><a href="#">category Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="/quize/index.php/admin/category/create">create category</a></li>
                	<li><a href="/quize/index.php/admin/category/admin">manage category</a></li>
					<li><a href="/quize/index.php/admin/category/index">index category</a></li>
			    </ul>
        </div>
        </li> -->
         <li><a href="#">Quiz Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
            		<li><a href="/clients/quiz/index.php/admin/quiz/create">create Quize</a></li>
            		<li><a href="/clients/quiz/index.php/admin/quiz/admin">manage Quize</a></li>
                </ul>
        </div>
        </li>
         <li><a href="#">Question Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
            		<li><a href="/clients/quiz/index.php/admin/questions/create">create Questions</a></li>
            		<li><a href="/clients/quiz/index.php/admin/questions/admin">manage Questions</a></li>
                	
                </ul>
        </div>
        </li>
        <!-- <li><a href="#">Option Management</a>
        <div style="opacity: 0; display: none;" class="sub">
            	<ul>
                	<li><a href="/quize/index.php/admin/options/create">create Options</a></li>
                	  <li><a href="/quize/index.php/admin/options/admin">manage Options</a></li>
					<li><a href="/quize/index.php/admin/options/index">index Options</a></li>
				
                </ul>
        </div>
        </li>-->
        <?php }?>
        </ul>
    
		<?php /*$this->widget('zii.widgets.CMenu',array(
			'id'=>'topnav',
			'items'=>array(
			array('url'=>array('/admin/profile/edit'), 'label'=>Yii::app()->getModule('admin')->t("My Profile"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$profileManage),
				array('url'=>array('/admin/cpanel'), 'label'=>Yii::app()->getModule('admin')->t("Manage User"), 'visible'=>AdminModule::isAdmin(),'itemOptions'=>$userManage),
			array('url'=>array('/admin/access'), 'label'=>Yii::app()->getModule('admin')->t("User Access"), 'visible'=>AdminModule::isAdmin(),'itemOptions'=>$accessTop),
			array('url'=>array('/admin/restaurantManagement'), 'label'=>Yii::app()->getModule('admin')->t("Restaurants"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$restaurantTop),
			array('url'=>array('/admin/locationManagement'), 'label'=>Yii::app()->getModule('admin')->t("Locations"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$locationsTop),
			array('url'=>array('/admin/emailTemplate'), 'label'=>Yii::app()->getModule('admin')->t("Email Templates"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$emailTemplateTop),
			array('url'=>array('/admin/staticPages'), 'label'=>Yii::app()->getModule('admin')->t("Static Pages"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$staticpagesTop),
			array('url'=>array('/admin/bannerDetails'), 'label'=>Yii::app()->getModule('admin')->t("Banner Management"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$bannerDetailsTop),
			array('url'=>array('/admin/customers'), 'label'=>Yii::app()->getModule('admin')->t("Customers"), 'visible'=>!Yii::app()->user->isGuest,'itemOptions'=>$customersTop),			
			
			),
		));*/ ?>

	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'homeLink'=>CHtml::link('Home', Yii::app()->createUrl("admin/login")), 
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>
	
    <div class="container">

		<?php echo $content; ?>

    </div>

	<div id="footer">
		<!--Copyright &copy; <?php //echo date('Y'); ?>. <br/>
		tastyplex.--><br/>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>